<?php

namespace app\admin\model\cart;

use think\Model;
use traits\model\SoftDelete;

class Cart extends Model
{


    //数据库
    protected $connection = 'database';
    // 表名
    protected $name = 'cart';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];


    public function member()
    {
        return $this->belongsTo('app\admin\model\member\Member', 'openid', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function goods()
    {
        return $this->belongsTo('app\admin\model\goods\Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
